﻿@model List<KRM.Core.sp_OrderHistory_Result>
<div class="small-scroll">
    <table class="table table-bordered table-fix" id="table1">
        <thead>
            <tr>
                <th></th>
                <th>OrderRef</th>
                <th>TradeOrderRef</th>
                <th>Status</th>
                <th>ItemValue</th>
                <th>Qty</th>
                <th>OrderItems</th>
                <th>DatePlaced</th>
                <th>Title</th>
                <th>FirstName</th>
                <th>Surname</th>
                <th>AddressLine1</th>
                <th>Postcode</th>
                <th>DespatchDate</th>
                <th>DeliveryDate</th>
                <th>TradeInvoiceID</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in @Model)
            {
                <tr>
                     <td style="max-width: none;overflow: visible;">
                        <div class="btn-group">
                            <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><span class="caret"></span></a>
                            <ul class="dropdown-menu dropdowm-right">
                                <li>  
                                    <a href="/orderview/orderdetail?orderref=@item.OrderRef" target="_blank">View Order</a>
                                </li>
                                <li>
                                    <a href="javascript:;" onclick="PopupCenter('/orderview/sendsms/@item.OrderID', 600, 450)">Send SMS</a>
                                </li>
                                <li>
                                    <a href="javascript:;" onclick="PopupCenter('/orderview/addtask/@item.OrderID', 500, 608)" >Add task</a>
                                </li>
                                <li style="@(item.TradeAccNumber==49?"":"display:none")">
                                    <a href="javascript:;" onclick="PopupCenter('/trade/sendreturnfeed?tradeCustomerId=@(item.TradeAccNumber)&orderid=@item.OrderID', 725, 350)">Return Feed</a>
                                </li>
                            </ul>
                        </div>
                    </td>
                    <td style=" @(item.OrderReturn==1?"background: orange":"")">@item.OrderRef</td>
                    <td>@item.TradeOrderRef</td>
                    <td>@item.Status</td>
                    <td>@item.ItemPrice</td>
                    <td>@item.Qty</td>
                    <td>@item.OrderItems</td>
                    <td>@item.DatePlaced</td>
                    <td>@item.Title</td>
                    <td>@item.FirstName</td>
                    <td>@item.Surname</td>
                    <td>@item.AddressLine1</td>
                    <td>@item.Postcode</td>
                    <td>@item.DespatchDate</td>
                    <td>@item.DeliveryDate</td>
                    <td>@item.TradeInvoiceID</td>
                </tr>
            }
        </tbody>
    </table>
</div>
